#ifndef __ACCEPTOR_H
#define __ACCEPTOR_H
#include "header.h"
#include "socket.hpp"
#include "inetaddress.hpp"
#include <string>
using std::string;
namespace moqi
{
class Acceptor
{
public:
    Acceptor(const unsigned int& port, const string& ip = "0.0.0.0");
    ~Acceptor();
    void ready();
    int accept();
    int getSockFd();
private:
    void bind();
    void listen();
    void setResuzeAddr(bool on);
    void setResuzePort(bool on);
    InetAddress _addr;
    Socket _sock;
};

}

#endif

